/**
 * Created by zhangxinwang on 17/02/2017.
 */
import React from 'react'


class TodoFooter extends React.Component {

  deleteAll() {
    this.props.clearDone()
  }
  changeAll(e) {
    this.props.changeTodoState(null, e.target.checked, true)
  }
  render() {
    let minus = this.props.todoCount - this.props.todoDoneCount
    return (
      <div className="todo-footer">
        <label>

          <input type="checkbox" checked={this.props.isAllChecked} onChange={this.changeAll.bind(this)} />全选
        <span className="item-left">还剩{minus}未完成</span>
        </label>
        <button onClick={this.deleteAll.bind(this)}>删除</button>
      </div>
    )
  }
}

export default TodoFooter